package Experiments;

import humanDetector.AbstractHumanDetector;
import humanDetector.BasicHumanDetector;

import java.util.List;

import org.apache.commons.lang3.time.DurationFormatUtils;
import org.apache.commons.lang3.time.StopWatch;

import pdi.IImg2ImgOperation;
import pdi.IO.CSVImgWriter;
import pdi.IO.ImgReader;
import pdi.IO.ImgWriter;
import pdi.IO.RawImgReader;
import pdi.IO.RawImgWriter;
import pdi.IO.SeqImgReader;
import pdi.core.Image;
import pdi.preprocessing.AbstractPreProcessing;
import pdi.preprocessing.BasicPreprocessing;
import pdi.segmentation.AbstractSegmentation;
import pdi.segmentation.ExtractGroundTruth;
import ImageProcessors.BatchProcessor;
import featureExtractors.AbstractFeatureExtraction;
import featureExtractors.HOGFeatures;
import featureExtractors.RawPixelsFeature;

public class GenerateFeatureFile {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		StopWatch stp = new StopWatch();
		stp.start();
		
		String dataSetDir = "C:\\Users\\RFSC\\Desktop\\DataSet\\CaltechPedestrianBenchmark\\evaluation_and_labeling_code\\data-INRIA";
		String featureFile = "./Data/hogFeatures.csv";
		
		AbstractPreProcessing prep = new BasicPreprocessing(3);
		AbstractSegmentation seg = new ExtractGroundTruth(2);
		AbstractFeatureExtraction fe = new HOGFeatures(8, 8, 64, 128);		
		AbstractHumanDetector hd = new BasicHumanDetector(prep, seg, fe, null);
		
		ImgReader reader = new SeqImgReader(dataSetDir);
		ImgWriter writer = new CSVImgWriter(featureFile);
		
		hd.genFeaturesFile(reader, writer);
		
		System.out.println(DurationFormatUtils.formatDuration(stp.getTime(), "HH:mm:ss.SS"));
				
	}

}
